package com.zhny.aiot.plugin.HeadControlBoxPlugin;

import com.zhny.aiot.plugin.HeadControlBoxPlugin.model.HeadControlBoxStoreEntity;
import com.zhny.aiot.plugin.ICenterFacilities;
import com.zhny.aiot.plugin.IDevice;
import com.zhny.aiot.plugin.model.DeviceEntity;
import com.zhny.aiot.plugin.model.FactoryType;
import com.zhny.aiot.plugin.model.StoreEntity;
import com.zhny.aiot.plugin.zhnygateway.GatewayServer;
import com.zhny.aiot.plugin.zhnygateway.device.ZhnyDeviceFactory;
import org.pf4j.Extension;
import org.pf4j.Plugin;
import org.pf4j.PluginWrapper;

/**
 * @author pengshuai
 * @date 2023-03-23 10:11
 */
public class HeadControlBoxPlugin extends Plugin {

    public HeadControlBoxPlugin(PluginWrapper wrapper) {
        super(wrapper);
    }

    @Extension
    public static class HeadControlBoxFactory extends ZhnyDeviceFactory<HeadControlBoxStoreEntity> {

        @Override
        public IDevice createDevice(ICenterFacilities centerFacilities, DeviceEntity entity) {
            return new HeadControlBoxDevice(GatewayServer.getInstance ().getEngine () ,this,centerFacilities,entity);
        }

        @Override
        public Class<? extends StoreEntity> storeClass() {
            return HeadControlBoxStoreEntity.class;
        }

        @Override
        public String getId() {
            return "zhny-head-control-box";
        }

        @Override
        public String getName() {
            return "首部控制箱(旧版-2.5项目使用)插件";
        }

        @Override
        public FactoryType getType() {
            return FactoryType.PumpController;
        }
    }
}
